home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
CLTREN.TAS
< prev
next >
Wrap
Text File
|
1992-04-11
|
2KB
|
61 lines
{cltren ver 1.0}
{This script REQUIRES THE GRAPHICS FUNCTION
}
{A simple script to look at the dynamics of stocks closing above
or below there daily average (h+l)/2. It shows a slightly different
picture than a staight advance decline line, if you run it against a
ticker file containing only dow jone ind. stocks it looks surprising
like the sp-500.
}
{Graphs :
1. Stocks above their daily average.
2. Stocks below their daily average.
3. A ratio of below/above stocks
4. A cumulative total of stocks above and below.
}
{Written by : Steve Hedlund 818-368-2897
}
{=====================================================================}
{SET UP STARTING VARIABLES}
{=====================================================================}
#max_quotes 50
#index spx
ma :=5; {periods in moving averages}
qs :=50; {number of periods}
{=====================================================================}
{SET UP ARRAYS}
{=====================================================================}
if first_ticker then begin
x : array;
x1 : array;
x2 : array;
x3 : array;
X4 : ARRAY;
X5 : ARRAY;
end;
{=====================================================================}
{CHECKS}
{=====================================================================}
if quote_count<qs then return;
{=====================================================================}
{COMPUTATIONS}
{=====================================================================}
for i=1;i<=qs;i=i+1;
if c[i] > (h[i]+l[i])/2 then x[i] := x[i]+1;else {stocks above average}
if c[i] < (h[i]+l[i])/2 then x1[i] := x1[i]+1; {stocks below average}
{=====================================================================}
{FINAL COMPUTATIONS AND GRAPHS}
{=====================================================================}
if last_ticker then begin
x3 :=div(x1,x); {compute ratio b/a }
X4 :=SUB(X,x1); {calculate cumm total 1}
X5 :=CUM(X4); {caluclate cumm total 2}
opengraph(5);
graph(x,MOV(x,ma,'S'),'Stocks Closing Above Daily Average');
graph(x1,MOV(x1,ma,'S'),'Stocks Closing Below Daily Average');
graph(x3,MOV(X3,ma,'S'),'Ratio of Stocks Below / Stocks Above');
GRAPH(X5,mov(x5,ma,'s'),'Cumulative Total');
graph(index,'Standard and Poors 500');
closegraph();
end;